package com.manage.controller;

import com.clms.common.R;
import com.manage.pojo.entity.TbClient;
import com.manage.pojo.vo.ClientVo;
import com.manage.service.ClientService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: clms-third
 * @description: 客户控制层
 * @author: 林子洁
 * @create: 2021-07-22 14:41
 **/
@RestController
@RequestMapping("/manage/client")
public class ClientController {
    @Resource
    private ClientService clientService;
    @PostMapping("/initClient/{currentPage}/{pageSize}")
    public R initClient(@PathVariable("currentPage") Integer currentPage,
                        @PathVariable("pageSize") Integer pageSize,
                        @RequestBody ClientVo clientVo){
        System.out.println(currentPage+pageSize);
        return clientService.initClient(currentPage,pageSize,clientVo);
    }
    @PostMapping("/insertClient")
    public R insertClient(@RequestBody TbClient client){
        return clientService.insertClient(client);
    }
    @GetMapping("updateStatus")
    public R updateStatus(@PathVariable("id") Integer id,@PathVariable("status") Integer status ){
        return clientService.updateStatus(id,status);
    }
}
